/*
 * bill.h
 *
 *  Created on: Apr 20, 2011
 *      Author: Gilad & Yotam
 */

#ifndef BILL_H_
#define BILL_H_

#include <stdbool.h>
#include "car.h"

typedef struct BillElement_t *BillElement;


/**
 * The goal of bill.h & bill.c is to define a new type of variable
 * which will be used throughout the rentals ADT to represent a bill
 * and hold all the info a line in the bill should hold.
 * for the use of this type as a data container in a list or a set,
 * two functions are declared:
 * void* copyBillElement(void* billElement) - for copying
 * void freeBillElement(void* billElement) - for freeing
 * there is no use for a comparing function nor for a sorting function,
 * in order to follow the stated instructions. and thats why they are not
 * declared.
 */

/**
 * creating a copy of a bill element and returning a pointer to it.
 * @param billElement - the element to copy
 * return:
 * 	NULL if memory allocation failed
 * 	a pointer to the newly created copy of the element if succeeded.
 */
void* copyBillElement(void* element);

/**
 * freeing memory allocated for the billElement
 * @param billElement - the bill element to free its memory allocation
 */
void freeBillElement(void* element);

/**
 * creating a new bill element
 * @param car - the car to copy the info from
 * @param kmDrove - the distance traveled
 * return:
 * 	the created element
 */
BillElement billCreateNewElement(Car car, int kmDrove);

/**
 * @param billElement - the bill element
 * return:
 * 	the car license number
 */
int billGetCarLicense(BillElement billElement);

/**
 * @param billElement - the bill element
 * return:
 * 	the car name
 */
char* billGetCarName(BillElement billElement);

/**
 * @param billElement - the bill element
 * return:
 * 	the distance traveled with this car
 */
int billGetKmDrove(BillElement billElement);

/**
 * @param billElement - the bill element
 * return:
 * 	the price per kilometer for this car
 */
int billGetPricePerKm(BillElement billElement);

/**
 * @param billElement - the bill element
 * return:
 * 	the answer to: should the bill for this car be presented as on sale
 */
bool billGetCarSaleStatus(BillElement billElement);
/**
 * @param billElement - the bill element
 * return:
 * 	the price to pay for the rent of this car
 */
int billGetPrice(BillElement billElement);

#endif /* BILL_H_ */
